import request from '@/utils/request.ts'

const baseURL = '/like'

/**
 * @name 点赞/取消点赞
 * @description 对帖子的点赞或取赞操作
 */
function action(data: any) {
  return request({
    method: 'POST',
    url: `${baseURL}/action`,
    data
  })
}

/**
 * @name 获取点赞数以及判断是否已点赞
 * @description 获取点赞数以及判断是否已点赞
 */
function count(data: any) {
  return request({
    method: 'POST',
    url: `${baseURL}/count`,
    data
  })
}

export default {
  action,
  count
}
